<?php
	include_once("db/Department.inc");
?>

<h1>Departments</h1>

<a href="?action=editDepartment">Add Department</a><br/>

<table cellspacing="0">
	<tr class="first">
		<td>&nbsp;</td>
		<td>Code</td>
		<td>Description</td>
	</tr>
	
<?php
	$descArray = Department::getAllDepartments();
	foreach ($descArray as $d) {
?>

	<tr>
		<td>&nbsp;
			<a href="?action=editDepartment&code=<?php print $d->id ?>" >Edit</a>
		&nbsp;
		</td>
		<td><?php print $d->id ?></td>
		<td><?php print $d->description ?>&nbsp;</td>
	</tr>

<?php
	}
?>

</table>